<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<p><input type="text" id="input-1"></p>
<p><input type="text" id="input-2"></p>
<p>
    <button onclick="o(1)">+</button>
    <button onclick="o(2)">-</button>
    <button onclick="o(3)">*</button>
    <button onclick="o(4)">/</button>
</p>
<p><input type="text" id="input-3"></p>
</body>
<script>

    function o(z) {
        var a=document.getElementById('input-1').value;
        var b=document.getElementById('input-2').value;
        if (z==1){
            d=Number(a)+Number(b);
        }
        if (z==2){
            d=Number(a)-Number(b);
        }
        if (z==3){
            d=Number(a)*Number(b);
        }
        if (z==4){
            d=Number(a)/Number(b);
        }
        document.getElementById('input-3').value=d;
    }
</script>
</html>